package com.oreilly.ez.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import java.util.Date;

@Data
@Entity
@Table(name = "walle_item")
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class WalleItem {

    @Id
    @GeneratedValue
    private Integer sid;
    private String scode;
    private String note;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date udate;


    @NotBlank(message = "标题不能为空")
    private String title;



    @ManyToOne
    @JoinColumn(name = "card_id")
    private WalleCard walleCard;





}
